<%@ Page Language="C#" MasterPageFile="~/Frame.Master" AutoEventWireup="true" Codebehind="UserRolesSet.aspx.cs"
    Inherits="BaseSystem._System.UserRolesSet" Title="Set User Roles" %>

<%@ Register Src="UserControl/ucTrees.ascx" TagName="ucTrees" TagPrefix="uc3" %>
<%@ Import Namespace="Auto.Data.HumanResource" %>
<%@ Import Namespace="Auto.Data.Security" %>
<%@ Register Src="UserControl/ucDivision.ascx" TagName="ucDivision" TagPrefix="uc2" %>
<%@ Register Src="UserControl/ucRolesTree.ascx" TagName="ucRolesTree" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain" runat="server">

    <script src="../_System/Script/Common.js" type="text/javascript"></script>
    
    <div>
        <div>
            <div class="TitleDivStyle">
                <asp:Label ID="Label1" runat="server" Text="<%$Resources:Base,UserRoleSet %>" CssClass="TitleStyle"></asp:Label></div>
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td nowrap="nowrap" style="width: 560px;" valign="top" class="borderStyle">
                        <table border="0" cellpadding="0" cellspacing="2">
                            <tr>
                                <td>
                                    <div class="OperateStyle">
                                        <%=Resources.Base.LoginUserID%>
                                        <asp:TextBox ID="txtUserID" runat="server" Width="75px"></asp:TextBox>
                                        <%=Resources.Base.Division%>
                                        <uc2:ucDivision ID="UcDivision1" runat="server" />
                                        <asp:Button ID="btnSearch" runat="server" Text="<%$Resources:Base,Search %>" OnClick="btnSearch_Click"
                                            CssClass="button_bak" />
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div style="z-index: 101; width: 100%; padding: 1px;" class="overStyle">
                                        <asp:GridView ID="GVUsers" runat="server" AutoGenerateColumns="False" OnRowCommand="GVUsers_RowCommand"
                                            CssClass="mainView" AllowSorting="True" OnSorting="GVUsers_Sorting" 
                                            Width="556px" AllowPaging="True" 
                                            onpageindexchanging="GVUsers_PageIndexChanging">
                                            <Columns>
                                                <asp:TemplateField HeaderText="<%$ Resources:Base,DivID %>" SortExpression="DivID">
                                                    <ItemTemplate>
                                                        <%# DataBinder.Eval(Container.DataItem, Division.FIELD_DivID).ToString() %>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="<%$ Resources:Base,DivName %>" SortExpression="DivName">
                                                    <ItemTemplate>
                                                        <%# DataBinder.Eval(Container.DataItem, Division.FIELD_DivName).ToString() %>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="<%$ Resources:Base,UserName %>" SortExpression="UserName">
                                                    <ItemTemplate>
                                                        <%# DataBinder.Eval(Container.DataItem,Users.FIELD_UserName).ToString() %>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="<%$ Resources:Base,UserID %>" SortExpression="UserID">
                                                    <ItemTemplate>
                                                        <%# DataBinder.Eval(Container.DataItem,Users.FIELD_UserID).ToString() %>
                                                        <asp:Label ID="lblUserID" runat="server" Text='<%# DataBinder.Eval( Container.DataItem,Users.FIELD_UserID) %>'
                                                            Visible="false"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField ShowHeader="False">
                                                    <ItemStyle Wrap="False" />
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument="<%# Container.DisplayIndex %>"
                                                            CommandName="SetRoles" ><%=Resources.Base.UserRoleSet%></asp:LinkButton>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <RowStyle CssClass="GridViewRowStyle" />
                                            <EditRowStyle CssClass="GridViewEditRowStyle" />
                                            <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                                            <PagerStyle CssClass="GridViewPagerStyle" />
                                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                                            <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                        </asp:GridView>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td nowrap="nowrap" id="tbRoles" runat="server" visible="false" valign="top">
                        <table border="0" cellpadding="0" cellspacing="2" width="300px" class="borderStyle">
                            <tr>
                                <td align="left" nowrap="nowrap" class="cellborderStyle">
                                    <%=Resources.Base.UserName%>
                                    <asp:Label ID="lblUserName" runat="server" Font-Underline="True"></asp:Label>,
                                    <%=Resources.Base.SetRoleNote%>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" class="cellborderStyle" style="background-color: #edf1f8;">
                                    <div id="trRolesDiv" class="overStyle">
                                        <uc1:ucRolesTree ID="UcRolesTree1" runat="server" />
                                        <%--<uc2:ucRolesTree ID="UcRolesTree1" runat="server" />--%>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" class="cellborderStyle">
                                    <asp:LinkButton ID="lkbtnOK" runat="server" OnClick="lkbtnOK_Click" Text="<%$Resources:Base,OK %>"></asp:LinkButton>&nbsp;
                                    <asp:LinkButton ID="lkbtnCancel" runat="server" OnClick="lkbtnCancel_Click" Text="<%$Resources:Base,Cancel %>"></asp:LinkButton></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </div>

    <script type="text/javascript">
//    function adjustSize()
//    {
//        var trrolesdiv=document.getElementById("trRolesDiv");
//        if(trrolesdiv!=null)
//        {
//            var setheight=document.documentElement.offsetHeight-95;
//            if(setheight>0)
//            {
//                trrolesdiv.style.height=setheight+"px";
//            }
//        }
//         
//    }

//    window.onload=function()
//    {
//        adjustSize();
//    }
//    window.onresize=function()
//    {
//        adjustSize();
//    }

    window.onload=function()
    {
        setHeight("trRolesDiv",-95);
    }
    window.onresize=function()
    {
        setHeight("trRolesDiv",-95);
    }


        
    </script>

</asp:Content>
